package com.demo.gateway.userservice.service;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.demo.gateway.userservice.entity.User;
import com.demo.gateway.userservice.mapper.UserMapper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;
import java.util.stream.Collectors;

@Service
public class UserService extends BasicService<User> {
    @Resource
    UserMapper mapper;

    public List<User> getList() {


       List<User> list = mapper
                .selectList(Wrappers.<User>query()
                        .select("name")
                        .lambda()
                        .eq(User::getId, "1"))
                .stream().map(u -> {
            u.setName("abc");
            return u;
        }).collect(Collectors.toList());
       return list;
    }




}
